<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="uct" uri="/WEB-INF/uct.tld" %>
<%@ taglib prefix="portal" uri="/WEB-INF/portal.tld" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<%@ include file="/common/sale/include/common-base.jsp"%>
	<script src="${ctx}/js/jquery-tools.min.js"></script>
  <title>当日成交查询</title>
  <!-- Tell the browser to be responsive to screen width -->
</head>

<!-- 以下是body主体内容的模块区域 -->
<body class="hold-transition ${sysUserColor} sidebar-mini">
<div class="wrapper">

  <!-- top start -->
  <%@include file="/common/sale/top-user.jsp" %>
  <!-- top end -->
  <!-- left start -->
  <%@include file="/common/sale/left-user.jsp" %>
  <!-- left end-->

<div class="content-wrapper">
	<div class="content">
		<div class="row">
			<div class="col-lg-12 rightmt">
           <div class="right_box">
          <!------搜索  start ------->
			  <form id="searchForm" class="form-horizontal">
					<input type="hidden" name="doCode" value="dymicSql"/>
					<input type="hidden" name="pageName" value="deal-list">
					<input type="hidden" name="formName" value="searchForm">
					<input type="hidden" name="trsOrderDone.w_delStatus" value="F">
					<input type="hidden" name="trsOrderDone.wl_dealTime" value="">
					<input type="hidden" name="trsOrderDone.userEname" value="${loginUser.userEname}"/> 
				 	<input type="hidden" name="orderBy"  value="trsOrderDone.create_time desc" />	 
				 	
				 	<!-- 我的搜索 start -->
			 		<h4 class="user_title">
					   <p><i class="fa fa-search"></i><span>当日成交搜索</span></p>
					 </h4>
					 
					<div class="form-group">	
						<label  class="col-sm-3 control-label">
							商品名称：
						</label>
						<div class="col-sm-2">
							<input type="text" class="form-control clean"  name="trsOrderDone.wl_proName" id="proName" value="" />
						</div>
						<label  class="col-sm-3 control-label">
							成交编号：
						</label>
						<div class="col-sm-2">
							<input type="text" class="form-control clean"  name="trsOrderDone.wl_contractNo" id="contractNo" value="" />
						</div>
						
				
					</div>
				<center>
				   <div class="box-footer clearfix">
				       <button type="button" class="btn btn-danger " onclick="getTableData();">查询</button> 
				       <button  type="button" class="btn btn-primary" onclick="cleanData('searchForm');">重置 </button>
				   </div>
				</center>
			  </form>
	     </div>
	     <!------- 搜索 end -------->
	     <!------- 列表 start -------->
            <div class="right_box" style="margin-top:20px;">
				         <!-- 我的挂牌搜索 start -->
								 <h4 class="user_title">
								   <p><i class="fa fa-line-chart"></i><span>当日成交列表</span></p>
								 </h4>
								
					    <!-- 我的挂牌搜索 end -->   
			            <table id="dataList" class="table table-hover user_table" >
			                <thead>
			                <tr>
			                   	<th>序号</th>
		                        <th>成交时间</th>
		                        <th>委托编号</th>
		                        <th>商品代码</th>
		                        <th>商品名称</th>
		                        <th>买卖方向</th>
		                        <th>成交数量</th>
		                        <th>成交价（元）</th>
		                        <!-- <th>手续费（元）</th> -->
		                        <th>成交金额（元）</th>
			                </tr>
			                </thead>
			                <tbody id="dataList-body">
			                </tbody>
			              </table>
		         	    <center>
		    	  			  <ul id="dataList-page"></ul>
		        		</center>
			        </div>
			        
	   
        <!------- 列表 end -------->
        </div>
        <!-- right end -->
      </div>
	  </div>
	  </div>
    <!-- Main end -->
</div>
  <!-- /.content-wrapper -->
  <!-- foot start -->
  <%@include file="/common/sale/foot-user.jsp" %>
  <!-- foot start -->
  

<div class="modal fade" id="my_modal_add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							×
						</button>
						<h4 class="modal-title">
							<font color="red">信息添加</font> 
						</h4>
					</div>

					<div class="modal-body">
						<form class="form-horizontal" role="form" id="addForm">
							<input type="hidden" id="addForm_formToken" name="formToken" >
							<input type="hidden" name="doCode" value="dymicSql"/>
							<input type="hidden" name="pageName"  value="trpDeal-list">
							<input type="hidden" name="formName"  value="addForm">
							<input type="hidden" name="trsOrderDone.delStatus" value="F">
						
							
					        <div class="box-body" id="addForm_submitFormData">
					          <!-- Custom Tabs -->
					          <div class="nav-tabs-custom">
					            <div class="tab-content">
					              <div class="tab-pane active" id="tab_1">
					              
									<div class="form-group">
						                  <label class="col-sm-3 control-label" >冻结持仓</label>
						                  <div class="col-sm-8">
						                	<input type="text" id="addForm_forzenNum" name="trsOrderDone.forzenNum" class="form-control clean" maxLength="50" required placeholder="必填项" />
						                  </div>
							        </div>

									<div class="form-group">
						                  <label class="col-sm-3 control-label" >商品ID</label>
						                  <div class="col-sm-8">
						                	<input type="text" id="addForm_proId" name="trsOrderDone.proId" class="form-control clean" maxLength="50" required placeholder="必填项" />
						                  </div>
							        </div>

									<div class="form-group">
						                  <label class="col-sm-3 control-label" >商品代码</label>
						                  <div class="col-sm-8">
						                	<input type="text" id="addForm_proNo" name="trsOrderDone.proNo" class="form-control clean" maxLength="50" required placeholder="必填项" />
						                  </div>
							        </div>

									<div class="form-group">
						                  <label class="col-sm-3 control-label" >商品名称</label>
						                  <div class="col-sm-8">
						                	<input type="text" id="addForm_proName" name="trsOrderDone.proName" class="form-control clean" maxLength="50" required placeholder="必填项" />
						                  </div>
							        </div>

									<div class="form-group">
						                  <label class="col-sm-3 control-label" >用户ID</label>
						                  <div class="col-sm-8">
						                	<input type="text" id="addForm_userId" name="trsOrderDone.userId" class="form-control clean" maxLength="50" required placeholder="必填项" />
						                  </div>
							        </div>

									<div class="form-group">
						                  <label class="col-sm-3 control-label" >用户账号</label>
						                  <div class="col-sm-8">
						                	<input type="text" id="addForm_userEname" name="trsOrderDone.userEname" class="form-control clean" maxLength="50" required placeholder="必填项" />
						                  </div>
							        </div>

									<div class="form-group">
						                  <label class="col-sm-3 control-label" >用户名称</label>
						                  <div class="col-sm-8">
						                	<input type="text" id="addForm_userCname" name="trsOrderDone.userCname" class="form-control clean" maxLength="50" required placeholder="必填项" />
						                  </div>
							        </div>

									<div class="form-group">
						                  <label class="col-sm-3 control-label" >成本价</label>
						                  <div class="col-sm-8">
						                	<input type="text" id="addForm_costPrice" name="trsOrderDone.costPrice" class="form-control clean" maxLength="50" required placeholder="必填项" />
						                  </div>
							        </div>

									<div class="form-group">
						                  <label class="col-sm-3 control-label" >买入成本</label>
						                  <div class="col-sm-8">
						                	<input type="text" id="addForm_buyPrice" name="trsOrderDone.buyPrice" class="form-control clean" maxLength="50" required placeholder="必填项" />
						                  </div>
							        </div>

									<div class="form-group">
						                  <label class="col-sm-3 control-label" >可用持仓</label>
						                  <div class="col-sm-8">
						                	<input type="text" id="addForm_useNum" name="trsOrderDone.useNum" class="form-control clean" maxLength="50" required placeholder="必填项" />
						                  </div>
							        </div>

									<div class="form-group">
						                  <label class="col-sm-3 control-label" >总持仓</label>
						                  <div class="col-sm-8">
						                	<input type="text" id="addForm_totalNum" name="trsOrderDone.totalNum" class="form-control clean" maxLength="50" required placeholder="必填项" />
						                  </div>
							        </div>

					              </div>					             
					              <!-- /.tab-pane -->
					            </div>
					            <!-- /.tab-content -->
					          </div>
					          <!-- nav-tabs-custom -->
					        </div>
			                <div class="box-footer">
				                <button type="button" class="btn btn-success pull-left" onclick="cannel('add');">取消</button>
				                <button type="button" class="btn btn-danger pull-right" onclick="add('addForm');">提 交</button>
				            </div>
						</form>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>		
</div>  

<div class="modal fade" id="my_modal_edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							×
						</button>
						<h4 class="modal-title">
							<font color="red">信息修改</font> 
						</h4>
					</div>
					<div class="modal-body">
						<form class="form-horizontal" role="form" id="editForm">
							<input type="hidden" id="editForm_formToken" name="formToken" >
							<input type="hidden" name="doCode" value="dymicSql"/>
							<input type="hidden" name="pageName"  value="trpDeal-list">
							<input type="hidden" name="formName"  value="editForm">
							<input type="hidden" id="w_goodsId" data-name="trsOrderDone.goodsId" name="trsOrderDone.w_goodsId"  value="">
							
							
					        <div class="box-body" id="editForm_submitFormData">
					          <!-- Custom Tabs -->
					          <div class="nav-tabs-custom">
					            <div class="tab-content">
					              <div class="tab-pane active" id="tab_1">
					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >冻结持仓</label>
					                  <div class="col-sm-8">
									  <input type="text" id="editForm_forzenNum" data-name="trsOrderDone.forzenNum" name="trsOrderDone.forzenNum" class="form-control clean" maxLength="50" required placeholder="必填项" />
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >商品ID</label>
					                  <div class="col-sm-8">
									  <input type="text" id="editForm_proId" data-name="trsOrderDone.proId" name="trsOrderDone.proId" class="form-control clean" maxLength="50" required placeholder="必填项" />
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >商品代码</label>
					                  <div class="col-sm-8">
									  <input type="text" id="editForm_proNo" data-name="trsOrderDone.proNo" name="trsOrderDone.proNo" class="form-control clean" maxLength="50" required placeholder="必填项" />
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >商品名称</label>
					                  <div class="col-sm-8">
									  <input type="text" id="editForm_proName" data-name="trsOrderDone.proName" name="trsOrderDone.proName" class="form-control clean" maxLength="50" required placeholder="必填项" />
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >用户ID</label>
					                  <div class="col-sm-8">
									  <input type="text" id="editForm_userId" data-name="trsOrderDone.userId" name="trsOrderDone.userId" class="form-control clean" maxLength="50" required placeholder="必填项" />
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >用户账号</label>
					                  <div class="col-sm-8">
									  <input type="text" id="editForm_userEname" data-name="trsOrderDone.userEname" name="trsOrderDone.userEname" class="form-control clean" maxLength="50" required placeholder="必填项" />
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >用户名称</label>
					                  <div class="col-sm-8">
									  <input type="text" id="editForm_userCname" data-name="trsOrderDone.userCname" name="trsOrderDone.userCname" class="form-control clean" maxLength="50" required placeholder="必填项" />
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >成本价</label>
					                  <div class="col-sm-8">
									  <input type="text" id="editForm_costPrice" data-name="trsOrderDone.costPrice" name="trsOrderDone.costPrice" class="form-control clean" maxLength="50" required placeholder="必填项" />
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >买入成本</label>
					                  <div class="col-sm-8">
									  <input type="text" id="editForm_buyPrice" data-name="trsOrderDone.buyPrice" name="trsOrderDone.buyPrice" class="form-control clean" maxLength="50" required placeholder="必填项" />
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >可用持仓</label>
					                  <div class="col-sm-8">
									  <input type="text" id="editForm_useNum" data-name="trsOrderDone.useNum" name="trsOrderDone.useNum" class="form-control clean" maxLength="50" required placeholder="必填项" />
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >总持仓</label>
					                  <div class="col-sm-8">
									  <input type="text" id="editForm_totalNum" data-name="trsOrderDone.totalNum" name="trsOrderDone.totalNum" class="form-control clean" maxLength="50" required placeholder="必填项" />
					                  </div>
					                </div>

					              </div>					             
					              <!-- /.tab-pane -->
					            </div>
					            <!-- /.tab-content -->
					          </div>
					          <!-- nav-tabs-custom -->
					        </div>
			                <div class="box-footer">
				                <button type="button" class="btn btn-success pull-left" onclick="cannel('edit');">取消</button>
				                <button type="button" class="btn btn-danger pull-right" onclick="edit('editForm');">提 交</button>
				            </div>
						</form>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>		
</div>  

<div win-title="查看窗口" class="modal fade" id="my_modal_view" tabindex="-2" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							×
						</button>
						<h4 class="modal-title">
							<font color="red">查看详情</font> 
						</h4>
					</div>
					<div class="modal-body">
						<form class="form-horizontal" role="form" id="viewForm">
					        <div class="box-body">
					          <!-- Custom Tabs -->
					          <div class="nav-tabs-custom">
					            <div class="tab-content">
					              <div class="tab-pane active" id="tab_1">
					              
					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >冻结持仓</label>
					                  <div class="col-sm-8">
										<span data-name="trsOrderDone.forzenNum"></span>
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >商品ID</label>
					                  <div class="col-sm-8">
										<span data-name="trsOrderDone.proId"></span>
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >商品代码</label>
					                  <div class="col-sm-8">
										<span data-name="trsOrderDone.proNo"></span>
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >商品名称</label>
					                  <div class="col-sm-8">
										<span data-name="trsOrderDone.proName"></span>
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >用户ID</label>
					                  <div class="col-sm-8">
										<span data-name="trsOrderDone.userId"></span>
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >用户账号</label>
					                  <div class="col-sm-8">
										<span data-name="trsOrderDone.userEname"></span>
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >用户名称</label>
					                  <div class="col-sm-8">
										<span data-name="trsOrderDone.userCname"></span>
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >成本价</label>
					                  <div class="col-sm-8">
										<span data-name="trsOrderDone.costPrice"></span>
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >买入成本</label>
					                  <div class="col-sm-8">
										<span data-name="trsOrderDone.buyPrice"></span>
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >可用持仓</label>
					                  <div class="col-sm-8">
										<span data-name="trsOrderDone.useNum"></span>
					                  </div>
					                </div>

					                <div class="form-group">
					                  <label class="col-sm-3 control-label" >总持仓</label>
					                  <div class="col-sm-8">
										<span data-name="trsOrderDone.totalNum"></span>
					                  </div>
					                </div>

					              </div>					             
					              <!-- /.tab-pane -->
					            </div>
					            <!-- /.tab-content -->
					          </div>
					          <!-- nav-tabs-custom -->
					        </div>
			                <div class="box-footer">
				                <button type="button" class="btn btn-success pull-right" onclick="cannel('view');">关闭</button>
				            </div>
						</form>
					</div>
				</div>
				<!-- /.modal-content -->
			</div>		
</div>
</body>

<!-- 以下是template列表模板的模块区域 -->
<script type="text/template" id="dataList-template">
	<? for ( var i = 0; i < rows.length; i++) {?>
		<tr>
			<td><?=(pageObj.currentPage-1)*10+(i+1)?></td>
			<td><?=strUtil.doNull(rows[i].dealTime,'')?></td>
			<td><?=strUtil.doNull(rows[i].orderNo,'')?></td>
			<td><?=strUtil.doNull(rows[i].proNo,'')?></td>
			<td class="text_l"><?=strUtil.doNull(rows[i].proName,'')?></td>
			<td>
					<?if(rows[i].orderFlag=="sell"){?>
							卖出
					<?}else{?>
							买入
					<?}?>
			</td>
			<td class="text_r"><?=strUtil.doNull(rows[i].dealNum,'')?></td>
			<td class="text_r">￥<?=fmoney(rows[i].dealPrice,'')?></td>
			<td class="text_r">￥<?=fmoney(rows[i].totalMoney,'')?></td>
		</tr>
   <?}?>  		
</script>

</html>

<!-- 以下是js模块区域 -->
<script>
var clickMenu = "deal-list";
var id,myPage,dataListId,searchFormId,isShowLog,tableSort,tableId;
myPage = 10;
dataListId = "dataList";
searchFormId = "searchForm";
tableSort = "trsOrderDone";
tableId = "dealId";
isShowLog = true;

$(function () {
	//0、页面加载时，将当天日期hiden给后台
	var date = new Date().format("yyyy-MM-dd");
	console.log(date+"@");
	$("input[name='trsOrderDone.wl_dealTime']").val(date);
	
	//1、加载分页列表数据
	getTableData();
	//2、控制是否启用token
	//setToken();
	
	//请在下面补充其他初始化方法（如数据字典、页面加载数据等）
	//3、初始化数据字典
 });
var dateObject = $('.datepicker').datepicker( {
	language : 'zh-CN',
	//inline: true,
	todayBtn : "linked",
	format : "yyyy-mm-dd",
	autoclose: true
});
//读取（查询、编辑）数据
function toLoad(id,type){
	var paramLoadData = {"trsOrderDone.w_goodsId":id,"modelTypes":"s_"+tableSort};
	loadObj(type,paramLoadData);
}
function toDele(id){
	var index_submit = layer.confirm('您确定要删除信息吗？', {btn: ['Yes','No'],closeBtn: 0,offset: '220px'}
	, function(){
		layer.close(index_submit);
		var paramLoadData = {"modelTypes":"d_trsOrderDone","trsOrderDone.w_goodsId":id};
		//var paramLoadData = {"modelTypes":"u_trsOrderDone","trsOrderDone.delStatus":"T","trsOrderDone.w_goodsId":id};
		doDele(paramLoadData);
	});
}
//反显数据
function showData(type,myData){
	console.log(myData);
	if("view"==type){
		FormUtil.loadView("trsOrderDone", myData);
		$("#my_modal_view").modal("show");
	}else if("edit"==type){
		//修改弹框时，初始化数据字典
		cleanData('editForm_submitFormData');
		FormUtil.loadView("trsOrderDone", myData);
		//FormUtil.fillData("#editForm", myData,"id");
		$("#w_"+tableId).val(myData.goodsId);
		$("#my_modal_edit").modal("show");
	}
}

$(function () {
	$('#'+dataListId+' tbody').on('click','tr', function (e) {
	     if ( $(this).hasClass('selected') ) {
	            //$(this).removeClass('selected');
	        }
	        else {
	            $('tr.selected').removeClass('selected');
	            $(this).addClass('selected');
	        }
	     id = $('tr.selected td').eq(0).html();
	   //  console.log($('tr.selected td').eq(1).html())
	} );
	
	
  });
//加载列表数据
function getTableData(){
	deleteAllRow(dataListId);
	//搜索框去除空格
	 $("#proName").val($("#proName").val().trim());
	 $("#contractNo").val($("#contractNo").val().trim());
	
	 $.ajax({
		   type:'get',
		   url:common_list_url,
		   data:$("#"+searchFormId).serialize()+getCurrentPage(common_list_url+"?"+$("#"+searchFormId).serialize(),myPage),
		   dataType:'json',
		   success: function(myData){
		   if(isShowLog)console.log(myData);
			var data = baidu.template(dataListId+"-template",eval(myData));  
			$("#"+dataListId+"-body").html(data);
			  var option= {
					   ele:$("#"+dataListId+"-page")[0],
					   total:myData.total,
					   fn:getTableData,
					   url:common_list_url+"?"+$("#"+searchFormId).serialize()
				   }
				generatePages(option);
		   }
		});	
  }

//设置模态框隐藏事件 
$( '#my_modal_add' ).on( 'show.bs.modal' ,function(e){  
	setToken();
}); 
//清空数据
function cleanData(id){
	$('#'+id).find(".clean").val("");//按照样式清空；
}
//打开添加页面
function toAdd(){
	cleanData('addForm_submitFormData');//清空模态窗口内数据
	$("#w_"+tableId).val("");
	$(".datepicker").val("");
	$('#my_modal_add').modal('show');
}

//获取对象值
function loadObj(type,paramData){
	$.ajax({
	    type:'get',
	   	url:common_info_url+"?doCode=dymicSql",
	    data: paramData,
	    async:false,
	    dataType:"json",
	    success: function(myData){
	    	showData(type,myData);
	  	}
	});	
}

//删除信息（逻辑删除）
function doDele(paramData){
	$.ajax({
	    type:"post",
	    url:common_submit_url+"?doCode=dymicSql",
	    data: paramData,
	    dataType:"json",
	    success: function(myData){
	    	var result = myData.flag;
	    	if(result=="T"){
	    		layer.alert("删除操作成功");
	    		refresh();
	    	}
	  	}
	});	
}

/**
 * 新增表单数据提交
 * @param formId
 */
function add(formId){
	var index_submit = layer.confirm('您确定要提交信息吗？', {btn: ['Yes','No'],closeBtn: 0,offset: '220px'}
	, function(){
		layer.close(index_submit);
		$.ajax({
		    type:"post",
		    url:common_submit_url,
		    data:$("#"+formId).serialize(),
		    dataType:"json",
		    success: function(myData){
		    	//console.log(myData);
		    	if(myData.flag=="T"){
		    		layer.alert("数据保存成功");
		    		$("#my_modal_add").modal("hide");
		    	}else{
		    		layer.alert(myData.msg);
		    	}
		    	refresh();
		  	}
		});	
	});
}

/**
 * 修改表单数据提交
 * @param formId
 */
function edit(formId){
	var index_submit = layer.confirm('您确定要提交信息吗？', {btn: ['Yes','No'],closeBtn: 0,offset: '220px'}
	, function(){
		layer.close(index_submit);
		$.ajax({
		    type:"post",
		    url:common_submit_url,
		    data:$("#"+formId).serialize(),
		    dataType:"json",
		    success: function(myData){
		    	//console.log(myData);
		    	if(myData.flag=="T"){
		    		layer.alert("数据保存成功");
		    		$("#my_modal_edit").modal("hide");
		    	}else{
		    		layer.alert(myData.msg);
		    	}
		    	refresh();
		  	}
		});	
	});
}

//关闭win
function cannel(type){
	if(strUtil.isNull(type)){
		$('#my_modal_add').modal('hide');
	}else{
		$('#my_modal_'+type).modal('hide');
	}
}

function refresh(){
	getTableData();
}


function setToken(){
	$.ajax({
	    type:'get',
	    url:'/sendPage/token?token=true',
	    dataType:'text',
	    success: function(myData){
	    	console.log(myData);
			$('#addForm_formToken').val(myData);
			$('#editForm_formToken').val(myData);
	  	}
	});	
}



/****  以下是自定义新增方法  ****/
 
</script>



